/*
 * Monster.java
 *
 * Copyright(c) 2010 - Kimnach
 * See main.Main.java for full copyright notice.
 *
 */

package monster;

/**
 * Monster class
 * @author dkimnach
 */
public class Monster {

    private int health;
    private int prestige;
    private String name;
    
    /**
     * Default mini monster health
     */
    public static final int MINI_HEALTH = 30;
    /**
     * Default mini monster prestige
     */
    public static final int MINI_PRESTIGE = 1;

    /**
     * Constructs a new monster
     * @param health
     * @param prestige
     */
    public Monster(String name, int health, int prestige) {
        this.name = name;
        this.health = health;
        this.prestige = prestige;
    }

    /**
     * Constructs a new monster
     * @param health health
     * @param prestige prestige
     * @param bonus
     */
    public Monster(String name, int health, int prestige, int bonus) {
        this.name = name;
        this.health = health;
        this.prestige = prestige + bonus;
    }
  
    /**
     * Damage the monster
     * @param dmg damage
     * @return new health
     */
    public int damage(int dmg) {
        health -= dmg;
        return health;
    }

    /**
     * Monster heals
     * @param dmg damage
     * @return new health
     */
    public int heal(int dmg) {
        health += dmg;
        return health;
    }

    /**
     * Monster gains prestige either through encounter bonus or special abilities
     * @param p prestige
     * @return new prestige
     */
    public int addPrestige(int p) {
        prestige += p;

        return prestige;
    }

    /**
     * Monster loses prestige
     * @param p prestige
     * @return new prestige
     */
    public int removePrestige(int p) {
        prestige -= p;

        return prestige;
    }

    /**
     * Get current health
     * @return health
     */
    public int getHealth() { return health; }
    /**
     * Get current prestige
     * @return prestige
     */
    public int getPrestige() { return prestige; }
}
